﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.Support.UI;
using SupportLibrary.WebMethod;


namespace SeleniumLab
{
    class Program
    {
        static void Main(string[] args)
        {
            IWebDriver driver;
            driver = new FirefoxDriver();
            driver.Navigate().GoToUrl("https://accounts.google.com/ServiceLogin?service=mail&passive=true&rm=false&continue=https://mail.google.com/mail/?tab%3Dwm&scc=1&ltmpl=default&ltmplcache=2");

            Dictionary<string, string> listTags = WebResource.Tags();

            foreach (KeyValuePair<String, String> tag in listTags)
            {
               
                Console.WriteLine(tag.Key + ":" + tag.Value);
                IList<IWebElement> list = driver.FindElements(By.TagName(tag.Key));
                List<string> attributes = WebResource.Attributes(tag.Value);
                for (int i = 0; i < list.Count; i++)
                {
                    foreach (string attr in attributes)
                    {
                        string attributevalue = list[i].GetAttribute(attr);
                        Console.WriteLine(attr + "=" + attributevalue );
                    }
                }

            }
            driver.Close();

           Console.Read();
            
        }
    }
}
